#ifndef OPENGL_HPP
#define OPENGL_HPP

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics/Color.hpp>

namespace sf {
    class View;
    class Shader;
    class Texture;
    class RenderTexture;
}

namespace smeg {
    namespace tools {

////////////////////////////////////////////////////////////
/// Setup the viewport, the projection and modelview matrix
///
/// \param _iLeft :                 Viewport left position
/// \param _iTop :                  Viewport top position
/// \param _iWidth :                Viewport width
/// \param _iHeight :               Viewport height
/// \param _pfProjectionMatrix :    Array of float representing the projection matrix
///
////////////////////////////////////////////////////////////
void SetupWindowProjection( int _iLeft, int _iTop, int _iWidth, int _iHeight, const float* _pfProjectionMatrix );

////////////////////////////////////////////////////////////
/// Render a quad with the given blending factors
///
/// \param _iLeft :                 Quad left position
/// \param _iTop :                  Quad top position
/// \param _iRight :                Quad right position
/// \param _iBottom :               Quad bottom position
/// \param _sBlendFactor :          Source blend factor
/// \param _dBlendFactor :          Destination blend factor
/// \param _QuadColor :             Quad color (default to white)
///
////////////////////////////////////////////////////////////
void RenderQuad( int _iLeft, int _iTop, int _iRight, int _iBottom, int _sBlendFactor, int _dBlendFactor, const sf::Color& _QuadColor = sf::Color::White );

////////////////////////////////////////////////////////////
/// Render a textured quad with the given blending factors
///
/// \param _iLeft :                 Quad left position
/// \param _iTop :                  Quad top position
/// \param _iRight :                Quad right position
/// \param _iBottom :               Quad bottom position
/// \param _sBlendFactor :          Source blend factor
/// \param _dBlendFactor :          Destination blend factor
/// \param _QuadColor :             Quad color (default to white)
///
////////////////////////////////////////////////////////////
void RenderTexturedQuad( int _iLeft, int _iTop, int _iRight, int _iBottom, int _sBlendFactor, int _dBlendFactor, const sf::Color& _QuadColor = sf::Color::White );

////////////////////////////////////////////////////////////
/// Render a texture with the given blending factors
///
/// \param _pTexture :              Texture to render
/// \param _iLeft :                 Quad left position
/// \param _iTop :                  Quad top position
/// \param _iRight :                Quad right position
/// \param _iBottom :               Quad bottom position
/// \param _iSBlendFactor :         Source blend factor
/// \param _iDBlendFactor :         Destination blend factor
///
////////////////////////////////////////////////////////////
void RenderTexture( const sf::Texture* _pTexture, int _iLeft, int _iTop, int _iRight, int _iBottom, int _iSBlendFactor, int _iDBlendFactor );

////////////////////////////////////////////////////////////
/// Render a shader with the given blending factors
///
/// \param _pShader :               Shader to render
/// \param _iLeft :                 Quad left position
/// \param _iTop :                  Quad top position
/// \param _iRight :                Quad right position
/// \param _iBottom :               Quad bottom position
/// \param _iSBlendFactor :         Source blend factor
/// \param _iDBlendFactor :         Destination blend factor
///
////////////////////////////////////////////////////////////
void RenderShader( const sf::Shader* _pShader, int _iLeft, int _iTop, int _iRight, int _iBottom, int _iSBlendFactor, int _iDBlendFactor );

    } // namespace tools
} // namespace smeg

#endif // OPENGL_HPP
